package com.example.practice;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;


import java.util.ArrayList;
import java.util.List;

public class FragmentAdpter extends FragmentPagerAdapter {
    String[] tabs = {"个人中心","充值记录","阈值设置"};
    List<Fragment> fragmentList =new ArrayList<>();
    public FragmentAdpter(FragmentManager fm, List<Fragment> fragmentList) {
        super(fm);
        this.fragmentList=fragmentList;
    }

    @Override
    public Fragment getItem(int i) {
        return fragmentList.get(i);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int i) {
        return tabs[i];
    }
}
